package com.edu.controller;

import com.edu.entity.CrmBanner;
import com.edu.service.CrmBannerService;
import com.edu.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 麦翔盛
 * @description: banner前台控制器
 * @date 2021/11/10 13:56
 */
@RestController
@CrossOrigin
@RequestMapping("/educms/front")
public class BannerFrontController {
    @Autowired
    private CrmBannerService bannerService;

    @GetMapping("/getAllBanner")
    public R getAllBanner(){
        List<CrmBanner> list =  bannerService.getAllBanner();
        return R.success().data("list",list);
    }
}
